package com.google.code.virtualhockey.vhx.shared.rpc.helper;

import com.google.code.virtualhockey.vhx.shared.rpc.ICommand;
import com.google.code.virtualhockey.vhx.shared.rpc.IResponse;

/**
 * Abstract default implementation for the {@link ICommand} interface.
 */
public abstract class AbstractCommand<T extends IResponse> implements ICommand<T>
{
  /** Some arbitrary information string. */
  private String m_strInfo;

  /**
   * Constructs a new AbstractCommand with a <code>null</code> information
   * string.
   */
  protected AbstractCommand()
  {
    this( null );
  }

  /**
   * Constructs a new AbstractCommand.
   *
   * @param strInfo the command information String
   */
  protected AbstractCommand( String strInfo )
  {
    m_strInfo = strInfo;
  }

  /**
   * Returns the information String that has been provided when the command was
   * instantiated.
   *
   * @see ICommand#getDispatchInfo()
   */
  public String getDispatchInfo()
  {
    return m_strInfo;
  }
}
